package test3.A1_4;

// 商品项类
class Product {
    private String title; // 名称
    private double weight; // 重量
    private String description; // 描述

    // 构造函数
    public Product(String title, double weight, String description) {
        this.title = title;
        this.weight = weight;
        this.description = description;
    }

    // 根据数量获取价格的方法
    public double getPriceForQuantity(int quantity) {
        // 这里假设商品的价格是固定的，实际应用中需要结合商品价格计算
        double pricePerItem = 10.0; // 假设每件商品10元
        return quantity * pricePerItem;
    }

    // 获取商品重量的方法
    public double getWeight() {
        return weight;
    }

    // Getter和Setter方法
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}